<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;

class SensitiveWord extends Model
{
    use HasDateTimeFormatter;

    protected $table = 'sensitive_word';
    public $timestamps = false;

    /**
     * 创建时间
     * @return Attribute
     */
    protected function createTime(): Attribute
    {
        return Attribute::make(
            get: fn($value) => \date('Y-m-d H:i:s', $value),
        );

    }

    /**
     * 更新时间。
     *
     * @return Attribute
     */
    protected function updateTime(): Attribute
    {
        return Attribute::make(
            get: fn($value) => \date('Y-m-d H:i:s', $value),
        );
    }

}
